package com.dl;

import java.util.Scanner;
import java.util.Set;

import com.dl.zd.BG;
import com.dl.zd.CX;
import com.dl.zd.XD;
import com.dl.zd.XFJL;
import com.dom4j.JE;
import com.dom4j.XF;
import com.dom4j.YM;
import com.test.Test;
import com.zc.ZC;

//登录功能的实现类
public class DL {
	static Scanner in = new Scanner(System.in);
	public static String num = null;
	public static String pwd = null;

	// 比较输入的手机号和xml里的是否一致
	public static boolean bj() {
		System.out.println("请输入手机号:");
		num = in.nextLine();
		System.out.println("请输入密码:");
		pwd = in.nextLine();
		return YM.bj(num, pwd);
	}

	public static void cJM() {
		if (bj()) {
			DL();
		}
	}

	// 二级界面
	public static void DL() {
		System.out.println("1.本月账单查询");
		System.out.println("2.套餐余量查询");
		System.out.println("3.打印消费详单");
		System.out.println("4.套餐变更");
		System.out.println("5.办理退网");
		System.out.println("6.返回上一层");
		if (in.hasNextInt()) {
			int a = in.nextInt();
			switch (a) {
			case 1:
				XFJL.XFJL();
				break;
			case 2:
				CX.CX();
				break;
			case 3:
				XD.XD();
				break;
			case 4:
				BG.BG();
				break;
			case 5:
				System.out.println("已删除你的账号，钱不退，谢谢");
				YM.sc(DL.num);
				JE.sc(DL.num);
				XF.sc(DL.num);
				in.nextLine();
				Test.zjm();
				break;
			case 6:
				in.nextLine();
				Test.zjm();
				System.exit(0);
			default:
				break;
			}
		} else {
			System.out.println("请输入数字");

		}
		in.nextLine();
		DL();
	}
}
